{% extends "common/layout_main.html" %}
{% block content %}
    {% include 'common/tab_member.html' %}
    <div class="row">
        <div class="col-lg-12">
            <table class="table table-bordered m-t">
                <thead>
                <tr>
                    <th>头像</th>
                    <th>姓名</th>
                    <th>美餐</th>
                    <th>评论内容</th>
                    <th>打分</th>
                </tr>
                </thead>
                <tbody>
                {% if pagination.items %}
                    {% for comment in pagination.items %}
                        <tr>
                            <td>
                                <img alt="image" class="img-circle"
                                     src="{{ comment_member_mapping[comment.member_id].avatar }}"
                                     style="width: 40px;height: 40px;">
                            </td>
                            <td>
                                {{comment_member_mapping[comment.member_id].nickname  }}
                            </td>
                            <td>
                                {% for food in comment_food_mapping[comment.id] %}
                                    {% for name,number in food.items() %}
                                         {{ name}}×{{ number }}&nbsp;&nbsp;
                                    {% endfor %}
                                {% endfor %}
                            </td>
                            <td>{{ comment.content }}</td>
                            <td>{{ comment.score  }}</td>
                        </tr>
                    {% endfor %}
                {% else %}
                    <tr>
                        <td colspan="5"> 暂无数据</td>
                    </tr>
                {% endif %}
                </tbody>
            </table>

            {% include 'common/pagenation.html' %}

        </div>
    </div>
{% endblock %}
